home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / GSOS / TN.GSOS.009 < prev    next >
Encoding:
Text File  |  1990-05-25  |  3.9 KB  |  86 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. GS/OS
  7. #9:    Interrupt Handling Anomalies
  8.  
  9. Revised by:    Matt Deatherage                                       May 1990
  10. Written by:    Dave Lyons                                        January 1990
  11.  
  12. This Technical Note discusses anomalies in the way GS/OS handles interrupts.
  13. Changes since January 1990:  Added discussions about calling UnbindInt at
  14. inopportune times and changes in GS/OS interrupt handling with respect to the
  15. Apple II High-Speed SCSI Card.
  16. _____________________________________________________________________________
  17.  
  18. Problems Installing Interrupt Handlers
  19.  
  20. If your application calls ALLOC_INT to install an interrupt handler for an
  21. external interrupt source, it works fine unless the SCSI Manager (GS/OS file
  22. SCSI.Manager) is installed, in which case the system eventually grinds to a
  23. halt with a message about 65536 unclaimed interrupts.
  24.  
  25. The Problems
  26.  
  27. If any interrupt handlers are bound (using BindInt) to reference number $17
  28. (IRQ.OTHER), the unclaimed interrupt count gets incremented if none of the
  29. BindInt routines claims the interrupt, even though any handlers installed
  30. with ALLOC_INT routines still need a chance to claim it.  The 5.0.2
  31. SCSI.Manager triggers this problem because it calls BindInt with vector
  32. reference number $17.
  33.  
  34. In addition, if one or more interrupt handlers are bound to the IRQ.OTHER
  35. vector (VRN $17), the interrupt is passed to the ALLOC_INT handler even if it
  36. was already claimed by a BindInt routine.  If no ALLOC_INT routine claims the
  37. interrupt, the unclaimed-interrupt count is incremented.  As documented in
  38. Apple IIgs Technical Note #18, Do-It-Yourself SCC Interrupts, you cannot 
  39. successfully call BindInt with vector reference number $0009.
  40.  
  41. The Solution
  42.  
  43. An application may install both a BindInt routine and an ALLOC_INT routine. 
  44. If they both claim the external interrupt, the unclaimed count does not get
  45. incremented.  The solution is compatible with future System Software
  46. releases, since it does not depend upon the ALLOC_INT routine ever getting
  47. called.
  48.  
  49. Your application's BindInt routine sees the interrupt before your ALLOC_INT
  50. routine does, so the BindInt routine should figure out whether the interrupt
  51. was caused by your external device, and claim it if so.  Your ALLOC_INT
  52. routine should claim an interrupt it sees if and only if your BindInt routine
  53. claimed the last interrupt it saw.
  54.  
  55. GS/OS 3.2, which was released with the Apple II High-Speed SCSI Card, no
  56. longer treats more than 64K unclaimed interrupts as a fatal error.  Note that
  57. GS/OS still displays a dialog box asking the user to restart the system, but
  58. choosing the Restart button returns control to the application with no ill
  59. effects.
  60.  
  61.  
  62. Problems Removing Interrupts Handlers
  63.  
  64. The GS/OS Reference suite says that device drivers may make BindInt and
  65. UnbindInt calls, noting this as an exception to the general rule that drivers
  66. may not make GS/OS system calls.  What the references fail to note is that
  67. these calls may fail for an incredibly annoying reason--the OS may be busy.
  68.  
  69. GS/OS takes special pains to avoid this while starting and while switching to
  70. ProDOS 8, but it does not avoid this condition during an OSShutDown--a real
  71. shutdown of the OS, not a switch to ProDOS 8.
  72.  
  73. Driver authors can work around this problem by using a new system service
  74. call provided in GS/OS version 3.2 and later.  The call, named
  75. UNBIND_INT_VECTOR, provides the functionality of UnbindInt to FSTs and
  76. drivers only to avoid the OS reentrancy issue.  The vector is at $01/FCD8 and
  77. takes an interrupt identification number (as returned from BindInt) in the
  78. accumulator.
  79.  
  80.  
  81. Further Reference
  82. _____________________________________________________________________________
  83.   o  GS/OS Reference
  84.   o  Apple IIgs Technical Note #18, Do-It-Yourself SCC Interrupts
  85.  
  86.